---
title: Examples
---

<Snippet file="run-pgvector-docker.mdx" />

## Run Jupyter on Docker

A jupyter notebook is a must have for AI development. Update the `resources.py` file to:

```python resources.py
from os import getenv

from agno.docker.app.jupyter import Jupyter
from agno.docker.app.postgres import PgVectorDb
from agno.docker.resources import DockerResources

# -*- PgVector running on port 5432:5432
vector_db = PgVectorDb(
    pg_user="ai",
    pg_password="ai",
    pg_database="ai",
    debug_mode=True,
)

# -*- Jupyter running on port 8888:8888
jupyter = Jupyter(
    mount_workspace=True,
    env_vars={"OPENAI_API_KEY": getenv("OPENAI_API_KEY")},
)

# -*- DockerResources
dev_docker_resources = DockerResources(
    apps=[vector_db, jupyter],
)
```

Start resources using:

<CodeGroup>

```bash Mac
ag start resources.py
```

```bash Windows
ag start resources.py
```

</CodeGroup>

### View Jupyterlab UI

- Open localhost:8888 to view the Jupyterlab UI. Password: **admin**
- The directory is automatically mounted in the notebook.

## Stop resources

<CodeGroup>

```bash Mac
ag stop resources.py
```

```bash Windows
ag stop resources.py
```

</CodeGroup>
